using System;

using OR.Reuse.Persistence;

using OR.Lazarus.Config;

namespace OR.Lazarus.Business
{
   public delegate void SourceCompileStartEventHandler( object sender, SourceCompileStartEventArgs e );
   public delegate void SourceCompileCompleteEventHandler( object sender, SourceCompileCompleteEventArgs e );

	/// <summary>
	/// Summary description for SourceCompiler.
	/// </summary>
	public class SourceCompileStartEventArgs : EventArgs
	{
      protected long mSourceSize;
      protected long mCompiledSize;

      public long CompiledSize
      {
         get { return mCompiledSize; }
         set { mCompiledSize = value; }
      }

      public long SourceSize
      {
         get { return mSourceSize; }
         set { mSourceSize = value; }
      }

      public Double Ratio
      {
         get { return this.GetRatio(); }
      }

      public Double GetRatio()
      {
         return ( Convert.ToDouble( mCompiledSize ) / Convert.ToDouble( mSourceSize ) );
      }

      public SourceCompileStartEventArgs()
      {
      }

      public SourceCompileStartEventArgs( long pSourceSize )
      {
         mSourceSize = pSourceSize;
      }

      public SourceCompileStartEventArgs( long pSourceSize, long pCompiledSize ) 
         : this( pSourceSize )
      {
         mCompiledSize = pCompiledSize;
      }
	}

   public class SourceCompileCompleteEventArgs : SourceCompileStartEventArgs
   {
      public SourceCompileCompleteEventArgs()
      {
      }

      public SourceCompileCompleteEventArgs( long pSourceSize ) : base( pSourceSize )
      {
         mSourceSize = pSourceSize;
      }

      public SourceCompileCompleteEventArgs( long pSourceSize, long pCompiledSize )
         : this( pSourceSize )
      {
         mCompiledSize = pCompiledSize;
      }
   }
}
